<?php defined( '_VALID_MOS' ) or die( include_once("../../404.php") );?>
<div id="box_lienhe">
	<div id="sub_box_lienhe">
		<div class="bg_tt_right"><div class="bg_tt_left"><div class="bg_tt"><div class="text_tt">SƠ ÐỒ WEBSITE</div></div></div></div>
		<div id="sub_box_lienhe1">
			<div class="ct_right">
				<div class="ct_left">
					<div class="ct">
				
					<table width="100%">
						<tr valign="top" align="left">
							<td width="60%">
								<div style="color:#FF0000; font-weight:bold"> MENU ÐỨNG</div>
								<div style="padding-top:10px;padding-left:50px;">
									<ul id="menu-item" class="jtree">
										<li id="internal-node"><div class="node-open"><span></span><a href="http://www.catratour.com">www.catratour.com</a></div>
											<ul>
												<?php											
													function _CSP_loadmenu($parent_Id='', $menu_type_id=''){
														include("protected/dbconnect.php");
														$sql = "SELECT `Id`, CONCAT(`link` , `link_id`) as `link`, `title`, `type`, `target` FROM `menu` where parent_Id = $parent_Id AND `menu`.`menu_type_id` = $menu_type_id  AND `activated` = 1 order by order_num";
														$cmd = $mysqli->prepare($sql);
														$cmd->execute();
														$cmd->store_result();
														$cmd->bind_result($id, $link, $title, $type, $target);
														while($cmd->fetch()){
															if($type == 'linkout'){														
																$Menu .= "<li><div class=\"node-open\"><span></span><a target=\"$target\" href=\"$link\">$title</a></div>";
																$Menu .= "<ul>";
																$Menu .= _CSP_loadsubmemu($id, $menu_type_id);
																$Menu .= "</ul>";
																$Menu .= "</li>";
															} else {
																$Menu .= "<li><div class=\"node-open\"><span></span><a target=\"$target\" href=\"$link/$id.csp\">$title</a></div>";
																$Menu .= "<ul>";
																$Menu .= _CSP_loadsubmemu($id, $menu_type_id);
																$Menu .= "</ul>";
																$Menu .= "</li>";
															}
														}
														return $Menu;
													}
																		
													function _CSP_loadsubmemu($id='', $menu_type_id=''){
														include("protected/dbconnect.php");
														$sql1 = "SELECT `Id`, CONCAT(`link` , `link_id`) as `link`, `title`, `type`, `target` FROM `menu` where parent_Id = $id AND `menu`.`menu_type_id` = $menu_type_id AND `activated` = 1  order by order_num";
														$cmd1 = $mysqli->prepare($sql1);
														$cmd1->execute();
														$cmd1->store_result();
														$cmd1->bind_result($sub_Id, $sub_link, $sub_title, $sub_type, $sub_target);
														if($cmd1->num_rows > 0){
															while($cmd1->fetch()){
																if($sub_type == 'linkout'){			
																	$Sub_Menu .=  "<li><div class=\"leaf\"><span></span><a target=\"$sub_target\" href=\"$sub_link\">$sub_title</a></div></li>";
																	$Sub_Menu .= _CSP_loadsubmemu($sub_Id, $menu_type_id);
																} else {		
																	$Sub_Menu .=  "<li><div class=\"leaf\"><span></span><a target=\"$sub_target\" href=\"$sub_link/$sub_Id.csp\">$sub_title</a></div></li>";
																	$Sub_Menu .= _CSP_loadsubmemu($sub_Id, $menu_type_id);
																}
															}
														}
														return $Sub_Menu;
													}
													
													echo _CSP_loadmenu(0,1);
												?>
											</ul>
										</li>					
											
									</ul>
								</div>
								<br>
								<div style="color:#FF0000; font-weight:bold"> MENU NGANG </div>
								<div style="padding-top:10px;padding-left:50px;">
									<ul id="menu-item" class="jtree">
										<li id="internal-node"><div class="node-open"><span></span><a href="http://www.catratour.com">www.catratour.com</a></div>
											<ul>
												<?php echo _CSP_loadmenu(0,2); ?>
											</ul>
										</li>					
											
									</ul>
								</div>
								<br>
							</td>
							<td width="40%">
							</td>
						</tr>
					</table>
				</div>
				</div>
			</div>
			<div class="bg_bt_right"><div class="bg_bt_left"><div class="bg_bt"><div class="text_bt">&nbsp;</div></div></div></div>
		</div>
	</div>
	<div class="clear"></div>
</div>